#include"inetAddr.h"

inetAddr::inetAddr(string addr,unsigned short port)
:_addr(addr)
,_port(port)
{
    _skaddr.sin_family = AF_INET;
    _skaddr.sin_port = htons(port); //主机到网
    _skaddr.sin_addr.s_addr = inet_addr(_addr.c_str());
}
inetAddr::~inetAddr(){}
struct sockaddr* inetAddr::getsockaddr(){
    return (sockaddr*)&_skaddr;
}